import vue from "@vitejs/plugin-vue";
import jsx from "@vitejs/plugin-vue-jsx";
import autoImport from './unplugin-auto-import'
import svgIcon from "./vite-plugin-svg-icons";
import vueSetupExtend from "vite-plugin-vue-setup-extend";
import viteCompression from './vite-plugin-compression'
import viteMockServe from './vite-plugin-mock'
import Components from './unplugin-vue-components'
import visualizer from './rollup-plugin-visualizer'
import Icons from './unplugin-icons'
import importToCDN from './vite-plugin-cdn-import'
import viteImagemin from './vite-plugin-imagemin'
import Inspect from './vite-plugin-inspect'
import warmup from './vite-plugin-warmup'
import progress from './vite-plugin-progress'
import createStyleImportPlugin from './vite-plugin-style-import'

export default function () {
	return [
		vue({
			script: {
				// @ts-ignore
				defineModel: true, // 开启defineModel功能
				propsDestructure: true, // 开启props结构响应式
			}
		}),
		jsx(),// * vite 可以使用 jsx/tsx 语法
		vueSetupExtend(),// * name 可以写在 script 标签上
		autoImport(), //自动导入
		svgIcon(), //svg图标使用
		...viteCompression(), //gzip压缩
		viteMockServe(), //mock
		Components(), //按需导入组件库
		visualizer(), //包体积分析
		Icons(), //iconify
		importToCDN(), //cdn优化
		viteImagemin(), //图片压缩
		Inspect(),//查看编译后代码
		warmup(), //文件预热插件
		progress(),//打包进度
		createStyleImportPlugin() //样式自动导入
	]
}


